﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace comm.lib
{
    [Serializable]
    public abstract class MapRange
    {
        static List<Type> _subTypeList = new List<Type>();
        static MapRange()
        {
            var type = typeof(MapRange);
            var types = type.Assembly.GetTypes();
            foreach (var type2 in types)
            {
                if (type2.IsSubclassOf(type))
                {
                    _subTypeList.Add(type2);
                }
            }
        }
        public static Type[] GetSubTypes()
        {
            return _subTypeList.ToArray();
        }

        public int OffsetX { get; set; }
        public int OffsetY { get; set; }

        [Serializable]
        public class Round : MapRange
        {
            int _radius = 2;
            public int Radius
            {
                get { return _radius; }
                set { _radius = value; }
            }

            public override string ToString()
            {
                return "r:" + Radius;
            }
        }
    }
}
